package com.example.application

import com.example.library.LibraryService
import com.example.library.Person
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author xiang
 * @Date 2022/9/8 16:40
 **/

@RestController
class AppController {

    @Autowired
    private lateinit var service: LibraryService

    @GetMapping("/name")
    fun getName(): String {
        return service.name()
    }

    @GetMapping("/persons")
    fun getPersons(): List<Person> {
        return service.persons()
    }

}